#ifndef SYSTEM_H
#define SYSTEM_H
#include "image_change.h"
#include <QDebug>
#include <QMessageBox>
#include "image_set.h"
#include <QTextCodec>
#include <QPainter>
#include <QJsonParseError>
#include <QJsonDocument>
#include <QVariant>

#define FILE_NAME __FILE__
#define LINE_COUNT __LINE__
#define getCodeLocate() QString("%1 line %2:").arg(FILE_NAME).arg(LINE_COUNT)   //注意不要加分号,不然不能当作返回值使用

extern  void debugInfo(const char* module, const char* line, const char* func, QString desc);
extern  void debugError(const char* module, const char* line, const char* func, QString desc);
extern  void debugWarning(const char* module, const char* line, const char* func, QString desc);
//extern  void debugFatal(const char* module, const char* line, const char* func, QString desc);

#define MY_FILE(x) strrchr(x, '/') ? strrchr(x, '/') + 1 : x

#define DEBUG_INFO(desc)                            (debugInfo(MY_FILE(__FILE__), QString::number(__LINE__).toStdString().c_str(), __FUNCTION__, (desc)))
#define DEBUG_WARNING(desc)                         (debugWarning(MY_FILE(__FILE__), QString::number(__LINE__).toStdString().c_str(), __FUNCTION__, (desc)))
#define DEBUG_ERROR(desc)                           (debugError(MY_FILE(__FILE__), QString::number(__LINE__).toStdString().c_str(), __FUNCTION__, (desc)))
//#define DEBUG_FATAL(desc)                          (debugFatal(__FILE__, QString::number(__LINE__).toStdString().c_str(), __FUNCTION__, (desc)))


#endif // SYSTEM_H
